package info;

import java.io.Serializable;
import java.sql.Date;
import java.sql.Timestamp;
import java.util.UUID;

public class Order implements Serializable {
    private String OrderNo;
    private String IDNO;
    private String Flight;
    private java.sql.Date Fdate;
    private String Fclass;
    private float Discount = 1.0f;
    private String OrderState;
    private String OrderTime;

    public Order() {
        this.OrderNo = generateOrderNo();
    }

    public Order(String orderNo, String IDNO, String flight, Date fdate, String fclass, String orderState, String orderTime) {
        OrderNo = orderNo;
        this.IDNO = IDNO;
        Flight = flight;
        Fdate = fdate;
        Fclass = fclass;
        OrderState = orderState;
        OrderTime = orderTime;
    }

    private String generateOrderNo() {
        return UUID.randomUUID().toString().replace("-", "").substring(0, 20);
    }

    public String getOrderNo() {
        return OrderNo;
    }

    public void setOrderNo(String orderNo) {
        OrderNo = orderNo;
    }

    public String getIDNO() {
        return IDNO;
    }

    public void setIDNO(String IDNO) {
        this.IDNO = IDNO;
    }

    public String getFlight() {
        return Flight;
    }

    public void setFlight(String flight) {
        Flight = flight;
    }

    public java.sql.Date getFdate() {
        return Fdate;
    }

    public void setFdate(java.sql.Date fdate) {
        Fdate = fdate;
    }

    public String getFclass() {
        return Fclass;
    }

    public void setFclass(String fclass) {
        Fclass = fclass;
    }

    public float getDiscount() {
        return Discount;
    }

    public void setDiscount(float discount) {
        Discount = discount;
    }

    public String getOrderState() {
        return OrderState;
    }

    public void setOrderState(String orderState) {
        OrderState = orderState;
    }

    public String getOrderTime() {
        return OrderTime;
    }

    public void setOrderTime(String orderTime) {
        OrderTime = orderTime;
    }

    @Override
    public String toString() {
        return "Order{" +
                "OrderNo='" + OrderNo + '\'' + '\n' +
                ", IDNO='" + IDNO + '\'' + '\n' +
                ", Flight='" + Flight + '\'' + '\n' +
                ", Fdate=" + Fdate + '\n' +
                ", Fclass='" + Fclass + '\'' + '\n' +
                ", Discount=" + Discount + '\n' +
                ", OrderState='" + OrderState + '\'' + '\n' +
                ", OrderTime=" + OrderTime +
                '}';
    }
}
